from selenium.webdriver.common.by import By
from jiaqizuoye.zuoye2.Page import Page
from selenium import webdriver
import pytest,json
@pytest.fixture()
def driver():
    driver=webdriver.Edge()
    driver.maximize_window()
    yield driver
    driver.quit()
def send_json(file):
    with open(file,encoding='utf8') as f:
        data=json.load(f)
    return [(i['username'],i['password'])for i in data]
@pytest.mark.parametrize('username,password',send_json('hj.json'))
def test_login(driver):
    po=Page(driver)
    po.test_jiuxian()